<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=9" />
	<meta name="description" content="Daily Parrot" /> 
	<meta name="keywords" content="daily,parrot,quotation" />
    <title>Daily Parrot Administration</title>
    <link rel="shortcut icon" href="/img/favicon.ico" />
    <link type="text/css" rel="stylesheet" href="/css/smoothness/jquery-ui-1.10.0.custom.min.css" />
    <link type="text/css" rel="stylesheet" href="/css/admin.css" />
    <script type="text/javascript" src="/js/jquery.1.9.0.min.js"></script>    
    <script type="text/javascript" src="/js/jquery-ui-1.10.0.custom.min.js"></script>    
    <script type="text/javascript" src="/js/admin.js"></script>
  </head>
  <body> 
  
  	<div class="actionbar">
  		<a id="create" href="javascript:void()">+ Neuer Spruch</a>
  		<div class="editform">
		    <form action="/admin/save" method="post" enctype="multipart/form-data" >
			  <div><input type="text" class="date" name="date" value="{{ newdate.day }}.{{ newdate.month }}.{{ newdate.year }}" /></div>
			  <div><input type="file" class="picture" name="picture" /></div>
		      <div><textarea name="content" rows="4" cols="100"></textarea></div>
		      <div><input type="submit" value="Speichern" /></div>
		    </form>
  		</div>
  	</div>
  	
    {% for quotation in quotations %}
      <div class="quotation">
      		<div class="readonly">
	      		<div class="date" title="{{ quotation.author }}">
	      			{{ quotation.day }}.{{ quotation.month }}.{{ quotation.year }}
	      		</div>
	      		{% if quotation.picture %}
	      		<div>
	      			<img src="/show-image?id={{ quotation.picture.key.id }}" />
	      		</div>
	      		{% endif %}
	      		<div class="content">{{ quotation.content|escape|linebreaksbr }}</div>
	      	</div>
	      	<div class="editform">
		      	<form action="/admin/save" method="post" enctype="multipart/form-data" >
			      <input type="hidden" name="id" value="{{ quotation.key.id }}" />
		      	  <div><input type="text" class="date" name="date" value="{{ quotation.day }}.{{ quotation.month }}.{{ quotation.year }}" /></div>
				  <div><input type="file" class="picture" name="picture" /></div>
			      <div><textarea name="content" rows="4" cols="100">{{ quotation.content|escape }}</textarea></div>
			      <div><input type="submit" value="Speichern" /></div>
			    </form>
	      	</div>
    		<a class="delete" href="/admin/delete?id={{ quotation.key.id }}">Löschen</a>
    		<a class="edit" href="javascript:void()">Bearbeiten</a>    		
      </div>
    {% endfor %}


  </body>
  
    <script type="text/javascript">

	  var _gaq = _gaq || [];
	  _gaq.push(['_setAccount', 'UA-38223339-1']);
	  _gaq.push(['_trackPageview']);
	
	  (function() {
	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	  })();

 </script>
 
</html>